<h3>操作中的“加号”用于关联方案到新的分类</h3>
<h3>操作中的“齿轮”用于修改当前行信息</h3>
<h3>操作中的“下箭头”用于查看已有的方案到分类的关联</h3>
<div id="product_lists">
	  <table>
		 <caption class="item_count">共有 <?php echo $item_count; ?> 条商品信息</caption>
		 <tr>
			 <th class="span-2">商品编号</th>
			 <th class="span-3">商品名称</th>
			 <th class="span-11">商品描述</th>
			 <th class="span-1">价格</th>
			 <th class="span-4">操作</th>
		 </tr>
<?php
foreach( $product_infos as $no=>$product_info ){
?>
	 <tr> 
<?php 
foreach( $product_info as $key=>$value ){
	if( $key == 'can_add_new_class' || $key == 'time' ){
		 continue;	
	}
	//如果所属的服务不为空 则需要显示一个按钮
	//点击显示本商品相关服务的下拉菜单
	if( $key == 'class_info' ){
		if( !empty( $value ) ){
			//判断该商品是否还可以
			//关联到其他的服务上
			echo "<td class='align_center have_class_info product_td $key'><span class='button edit'>修改</span><span class='button detail'>具体</span>";
			if( @$product_info['can_add_new_class'] == TRUE ){
				echo "<span class='button add'>添加</span>";
			}
			echo "<span class='button del'>删除</span></td>";
		}else{
			echo "<td class='align_center havenot_class_info product_td $key'><span class='button edit'>修改</span><span class='button add'>添加</span><span class='button del'>删除</span></td>";
		}
	}else{
?>
	<td class="product_td <?php 
		if( $key == 'price' || $key == 'class_info' ){
			 echo " align_center ";
		}
		if( $key == 'product_id' ){
			 echo " align_center ";
		}
		echo " $key";
?>"><?php echo $value; ?></td>
<?php
	}
}
?>		 
	 </tr>
<?php
}
?>
	  </table>
</div>
<div id="pager_links"><?php echo $pager_links; ?></div>
<!--确认弹出框-->
<div id="dialog-confirm"></div>
<!--消息弹出框-->
<div id="dialog-message"><?php echo $res['info'];?></div>

<div id="dialog-form" title="" style="display:none;">
	<form>
	<fieldset>
		<!--input type="hidden" id="product_id" name="product_id" value=""/-->
		<p>
			<label for="product_class_id">所属服务</label><br />
			<select id="product_class_id" name="product_class_id"></select>
		</p>
		<p>
			<label for="title">商品标题</label><br />
			<input type="text" name="title" id="title" class="text ui-widget-content ui-corner-all" />
		</p>
		<p>
			<label for="describe">商品描述</label><br />
			<textarea class="text ui-widget-content ui-corner-all" name="describe" id="describe"></textarea>
		</p>
		<p>
			<label for="price">价格</label><br />
			<input type="price" name="price" id="price" value="" class="text ui-widget-content ui-corner-all" />
		</p>
	</fieldset>
	</form>
</div>
<script type="text/javascript">
//用来显示提交表单之后后台返回的信息
(function( this_el ){
	if( this_el.text() != '' ){
		this_el.dialog( "destroy" );
		this_el.dialog({
			modal: true,
			buttons: {
				Ok: function() {
					$( this ).dialog( "close" );
				}
			}
		});			
	}
	//设置一个 timmer 
	var timer_id = setTimeout( function(){
		this_el.text( '' );
		this_el.dialog( "destroy" );
	} , 1000 );  	
})( $( '#dialog-message' ) );
</script>
<script type="text/javascript" src="/js/admin_show_product.js"></script>

